<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>橘子汽车租赁</title>
    <script type='text/javascript' charset='utf-8' src='https://www.layuicdn.com/layui-v2.5.6/layui.js'></script>
	<link rel='stylesheet' type='text/css' href='https://www.layuicdn.com/layui-v2.5.6/css/layui.css' />
	<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
    <style type="text/css">
    	.my-body{
    		position: absolute;
    		top: 60px;
    		left: 200px;
    		right: 0px;
    		bottom: 0px;
    		background-color: #F2F2F2;
    	}
	</style>
</head>
<body class="layui-layout-body">
    <div class="layui-layout layui-layout-admin">
        <div class="layui-header">
            <div class="layui-logo"><a style="color: white;" href="">橘子汽车租赁</a></div>
			<ul class="layui-nav layui-layout-right">
				<li class="layui-nav-item" lay-unselect><a href="http://www.hbeu.cn/" target="_blank">公司官网</a></li>
				<li class="layui-nav-item" lay-unselect><a href="http://www.hbeu.cn/" target="_blank">帮助中心</a></li>
				<li class="layui-nav-item">
					<a href="javascript:;" th:text="${name}"></a>
					<dl class="layui-nav-child">
						<dd>
							<a href="javascript:;" id="logout">退出</a>
						</dd>
					</dl>
				</li>
			</ul>
        </div>
        <div class="layui-side layui-bg-black">
        	<div class="layui-side-scroll">
				<ul class="layui-nav layui-nav-tree" lay-filter="base">
					<li class="layui-nav-item layui-this"><a layui-id="01" href="javascript:;">主页</a></li>
					<li class="layui-nav-item"><a layui-id="02" href="javascript:;">客户管理</a></li>
					<li class="layui-nav-item"><a layui-id="03" href="javascript:;">车辆管理</a></li>
					<li class="layui-nav-item">
					    <a href="javascript:;">业务管理</a>
					    <dl class="layui-nav-child">
					    	<dd><a layui-id="04" href="javascript:;">汽车出租</a></dd>
							<dd><a layui-id="05" href="javascript:;">汽车入库</a></dd>
					     	<dd><a layui-id="06" href="javascript:;">出租单管理</a></dd>
					    </dl>
					</li>
					<li class="layui-nav-item" th:if="${type == 1}">
					    <a href="javascript:;">系统管理</a>
					    <dl class="layui-nav-child">
							<dd><a layui-id="101" href="javascript:;">车辆管理</a></dd>
							<dd><a layui-id="102" href="javascript:;">出租单管理</a></dd>
							<dd><a layui-id="103" href="javascript:;">检查单管理</a></dd>
							<dd><a layui-id="104" href="javascript:;">用户管理</a></dd>
							<dd><a layui-id="105" href="javascript:;">系统公告</a></dd>
					    </dl>
					</li>
					<li class="layui-nav-item" th:if="${type == 1}">
						<a href="javascript:;">统计分析</a>
						<dl class="layui-nav-child">
							<dd><a layui-id="201" href="javascript:;">客户地区统计</a></dd>
							<dd><a layui-id="202" href="javascript:;">公司年度月份销售额</a></dd>
							<dd><a layui-id="203" href="javascript:;">业务员年度销售额</a></dd>
						</dl>
					</li>
					<li class="layui-nav-item"><a layui-id="07" href="javascript:;">个人中心</a></li>
					<li class="layui-nav-item"><a layui-id="08" href="javascript:;">关于</a></li>
				</ul>
			</div>
		</div>
        <div class="my-body" style="background-color: #F2F2F2;">
			<iframe id="body"
					frameborder=”no”
					border=”0″
					marginwidth=”0″
					marginheight=”0″
					scrolling=”no”
					allowtransparency=”yes”
					src="home.html" height="100%" width="100%"></iframe>
        </div>
    </div>
    <script type="text/javascript">
    	//判断是否在iframe中
    	if (self.frameElement && self.frameElement.tagName == "IFRAME") {
    	　　 parent.location.reload();
    	}
    	dialog = -1;
	    layui.use(['element', 'layer'], function() {
	    	if(dialog != -1){
	    		layer.msg('加载中');
	    	}
			let element = layui.element; //导航的hover效果、二级菜单等功能，需要依赖element模块
			let layer = layui.layer;
			element.on('nav(base)', function(elem){
				var id = $(this).attr('layui-id');
				if(id == '01'){
					$("#body").attr('src', 'home.html');
				}else if(id == '02'){
					$("#body").attr('src', 'customer.html');
				}else if(id == '03'){
					$("#body").attr('src', 'car.html');
				}else if(id == '04'){
					$("#body").attr('src', 'business/rent.html');
				}else if(id == '05'){
					$("#body").attr('src', 'business/check.html');
				}else if(id == '06'){
					$("#body").attr('src', 'business/rents.html');
				}else if(id == '07'){
					$("#body").attr('src', 'self');
				}else if(id == '08'){
					$("#body").attr('src', 'about.html');
				}else if(id == '101'){
					$("#body").attr('src', 'system/car.html');
				}else if(id == '102'){
					$("#body").attr('src', 'system/rent.html');
				}else if(id == '103'){
					$("#body").attr('src', 'system/check.html');
				}else if(id == '104'){
					$("#body").attr('src', 'system/user.html');
				}else if(id == '105'){
					$("#body").attr('src', 'system/announcement.html');
				}else if(id == '106'){
					$("#body").attr('src', 'system/actuator.html');
				}else if(id == '201'){
					$("#body").attr('src', 'statistics/region.html');
				}else if(id == '202'){
					$("#body").attr('src', 'statistics/company.html');
				}else if(id == '203'){
					$("#body").attr('src', 'statistics/salesman.html');
				}
			});
			document.getElementById('body').onload = function(){
				layer.close(dialog);
				dialog = -1;
			}
			$("#logout").on('click', function (){
				layer.confirm('确认退出？', {icon: 3, title:'提示'}, function(index){
					location.href = "user/logout";
					layer.close(index);
				});
			})
		});
    </script>
</body>
</html>